package LeetCode.tree;

public class TreeNode {
    public char val;
    public int data;
    public TreeNode left;
    public TreeNode right;
    public static TreeNode root;

    public TreeNode(char val) {
        this.val = val;
    }
    public TreeNode(int data) {
        this.data = data;
    }
    public static TreeNode createTree1(){
        TreeNode a = new TreeNode('A');
        TreeNode b = new TreeNode('B');
        TreeNode c = new TreeNode('C');
        a.right = b;
        b.right = c;
        root = a;
        return a;
    }
    public static TreeNode createTree2(){
        TreeNode a = new TreeNode(1);
        TreeNode b = new TreeNode(2);
        TreeNode c = new TreeNode(3);
        TreeNode d = new TreeNode(4);
        a.left = b;
        a.right = c;
        b.left = d;
        root = a;
        return root;
    }
}
